The detection of sudden changes in image intensity for identifying an edge in an image is known as edge detection, a commonly used technique in image processing and computer vision. Edges define an outline of an object (i.e. a boundary between an object and its background or between an object and another object). When the edges of an object in an image are accurately identified, a location of the object within the image can be determined and further analysis of the object's properties may be accomplished.
For instance, in manufacturing plants or factories, industrial machine vision systems may perform edge detection as a means of assessing manufacturing quality. For example, the vision system may be adapted to measure and verify dimensions of an object based on the location of identified edges. In another example, the vision system may be adapted to use edge detection to localise labels on bottles speeding by on a production line, such that the label and the information provided thereon may be further analysed.
In the field of artificial intelligence, where computers such as robots are adapted to simulate human behavior, edge detection may also be used to analyse and comprehend the surrounding environment.
There are numerous known algorithms that are applied in image processing systems for enhancing or detecting edges. Each such algorithm has its respective advantages and disadvantages. One common disadvantage is the inability to accurately detect the actual edges in the image due to noise and lighting effects in the image.
A particular image processing algorithm for identifying an edge in an image portion uses the slope (i.e. first derivative) of a one-dimensional intensity profile of the image portion, as shown in FIG. 1. Since this slope represents the intensity variation in the image portion, an extremum of the slope 100 (i.e. a peak/maximum or a valley/minimum) may indicate the presence of an edge in the corresponding image portion, depending on a degree of sensitivity of the algorithm. The algorithm relies on a global threshold, which represents the minimum variation in the intensity profile (i.e. the minimum positive slope value or the maximum negative slope value) to be considered for identifying an edge and thus sets the degree of sensitivity with which edges are identified. In other words, each extremum of the slope 100 may be indicative of the presence of a potential edge (or edge candidate), the algorithm determining whether or not each potential edge is an actual edge at least in part on a basis of the global threshold. This global threshold may be established on the basis of various factors, for example according to an image quality, preliminary trials or a best-fit-all value that is built into the algorithm. Furthermore, the global threshold may be set by a user or automatically according to an analysis of the image and its properties. In one example, the global threshold is set according to the best-fit-all value, such as for example 2% of a maximum possible total intensity value.
As shown in FIG. 1, global threshold 102A is defined for the positive portion of the slope 100, while global threshold 102B is defined for the negative portion of the slope 100. A point on the positive portion of slope 100 is an edge candidate if its intensity variation is greater than the global threshold 102A, while a point on the negative portion of slope 100 is an edge candidate if its intensity variation is smaller than the global threshold 102B. In a specific example of use, for each section of the slope 100 that extends between two consecutive crossings of the global threshold by the slope 100, the edge detection algorithm may define that only the highest/lowest peak/valley above/below the respective global threshold is considered to represent a positive/negative edge for the profiled image portion. Thus, in the example of FIG. 1, peak 104A would be identified as representing a positive edge, while peak 106A would be ignored and considered to be noise. However, valleys 104B and 106B would both be identified as representing a respective negative edge. For each slope peak or valley identified as being representative of an edge in the image portion, the actual edge location in the image portion may be determined on a basis of the corresponding position of the peak or valley along the x-axis of the coordinate system of the image portion.
In this known edge detection algorithm, a single, constant threshold is used to analyse all points of the intensity variation 100 for identifying edges in the image portion (i.e. for the entire image portion being analysed). Unfortunately, this provides a limited amount of sensitivity for filtering out noise and lighting effects from actual edges in the image, such that certain edges in the image may be overlooked and considered as noise, while noise and or lighting effects in the image may be falsely identified as edges.
More specifically, such an edge detection algorithm will often fail to detect all edges of an image portion when the intensity profile of the image portion is ambiguous, for example due to noise or ambiguous edges in the image portion. In one possible scenario, when an image portion includes multiple potential edges of the same polarity within proximity of one another, this may create an ambiguous edge region in the intensity profile and it may be impossible to identify all of the actual edges from the slope of the intensity profile using a single, constant global threshold. Taking for example the particular intensity profile illustrated in FIG. 19, the intensity profile 1900 varies gradually from a low intensity value to a higher intensity value and includes three consecutive potential edges, which correspond to three extrema on the slope 1902 of this intensity profile 1900. In such a scenario, of the three potential edges, the use of a single, constant global threshold 1903 to analyse the slope 1902 of the intensity profile 1900 will only allow to locate one or two of these edges. Even if the global threshold 1903 were varied (i.e. set to different, constant values in an attempt to obtain different edge detection results) to 1903A or 1903B for example, the maximum possible number of edges identified by this technique for a particular one of these global thresholds would be two. Thus, the standard global threshold-based algorithm is incapable of locating all of the edges within such an image portion, and this exemplary scenario illustrates an unfortunate limitation of the global threshold-based algorithm which is often problematic in edge detection applications.
There thus exists a need in the industry to provide an edge detection method and system that is adapted to robustly and adaptively identify all of the actual edges in an image portion, irrespective of ambiguity in the corresponding intensity profile or changes therein that may be caused by noise or other types of undesirable light effects.